﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using SoftSource.Common;
using SoftSource.Timecard.Web.Data;

namespace SoftSource.Timecard.ReportDataClasses
{
    public sealed class ProjectEndDateReportTemplateData
    {
        public ProjectEndDateReportTemplateData()
        {
            this.Projects = new ObservableCollection<ProjectSummary>();
            this.Projects.Populate(App.Model.ProjectSummaries.Entities
                .Where(p => p.StatusID == ProjectStatus.Active)
                .OrderBy(p => p.Name));
            this.EndDate = DateTime.Now;
        }

        public ObservableCollection<ProjectSummary> Projects { get; set; }

        [Parameter]
        public int ProjectID { get; set; }

        [Parameter]
        public DateTime EndDate { get; set; }
    }
}
